﻿using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
using UnityEngine.UIElements;

[CreateAssetMenu(fileName = "scriptob.asset", menuName = "Asset/ScriptObject/scriptob", order = 0)]
public class ScriptableOb : ScriptableObject
{
    public Vector2 sliderValue;

    [MenuItem("Assets/ScriptableOb/Show")]
    public static void ReClick()
    {
        ScriptableOb target = Selection.activeObject as ScriptableOb;
        Debug.Log(target.sliderValue);
    }

    //控制右键菜单中此项是否可用
    [MenuItem("Assets/ScriptableOb/Show", true)]
    public static bool IsValid()
    {
        return Selection.activeObject is ScriptableOb;
    }
}